package com.baibei.ebec.guide;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.baibei.crossboarder.R;
import com.baibei.module.AppRouter;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

@Route(path = AppRouter.ROUTE_NEW_HAND)
public class NewHandActivity extends Activity {


    @BindView(R.id.iv)
    ImageView iv;
    @BindView(R.id.tv_skip)
    TextView tvSkip;

    private int click;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_hand);
        ButterKnife.bind(this);
        init();
    }

    private void init() {
        switch (click){
            case 0:
                iv.setImageResource(R.drawable.ddtj1);
                break;
            case 1:
                iv.setImageResource(R.drawable.ddtj2);
                break;
            case 2:
                iv.setImageResource(R.drawable.ddtj3);
                break;
            case 3:
                iv.setImageResource(R.drawable.ddtj4);
                break;
            default:
                toHome();
        }
    }


    private void toHome() {
        AppRouter.routeToMain(this);
        finish();
    }

    @OnClick({R.id.iv, R.id.tv_skip})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv:
                click += 1;
                init();
                break;
            case R.id.tv_skip:
                toHome();
                break;
        }
    }
}
